<?php
// +----------------------------------------------------------------------
// | 小牛Admin
// +----------------------------------------------------------------------
// | Website: www.xnadmin.cn
// +----------------------------------------------------------------------
// | Author: dav <85168163@qq.com>
// +----------------------------------------------------------------------

namespace app\common\model;

use think\Model;

class ProductModel extends Model
{
    protected $name = 'product';

    public function getStatusAttr($value,$data)
    {
        $arr = [
            '1' => '上架',
            '2' => '下架',
        ];
		
        return $arr[$data['status']];
    }
    public function getHomeAttr($value,$data)
    {
        $arr = [
            '0' => '否',
            '1' => '是',
        ];
    	
        return $arr[$data['home']];
    }
}